//
//  SelectView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/13.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "SelectView.h"
#import <Masonry.h>
@implementation SelectView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews
{
    self.backgroundColor = [UIColor colorWithRed:248 / 255.0 green:248 / 255.0 blue:248 / 255.0 alpha:1];
    
    self.totalBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.totalBtn.backgroundColor = [UIColor whiteColor];
    [self.totalBtn setTitle:@"全部" forState:(UIControlStateNormal)];
    [self.totalBtn setTitleColor:[UIColor colorWithRed:91 / 255.0 green:113 / 255.0 blue:255 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.totalBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    self.totalBtn.layer.borderWidth = 1;
    self.totalBtn.layer.borderColor = [UIColor colorWithRed:91 / 255.0 green:113 / 255.0 blue:255 / 255.0 alpha:1].CGColor;
    self.totalBtn.layer.cornerRadius = 18;
    [self addSubview:self.totalBtn];
    [self.totalBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.height.mas_equalTo(36);
    }];
    
    
    
    self.shareProfitBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.shareProfitBtn.backgroundColor = [UIColor whiteColor];
    [self.shareProfitBtn setTitle:@"分润" forState:(UIControlStateNormal)];
    [self.shareProfitBtn setTitleColor:[UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.shareProfitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    self.shareProfitBtn.layer.cornerRadius = 18;
    [self addSubview:self.shareProfitBtn];
    [self.shareProfitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.height.mas_equalTo(36);
    }];
    
    
    self.withdrawBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.withdrawBtn.backgroundColor = [UIColor whiteColor];
    [self.withdrawBtn setTitle:@"提现" forState:(UIControlStateNormal)];
    [self.withdrawBtn setTitleColor:[UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1] forState:(UIControlStateNormal)];
    self.withdrawBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    self.withdrawBtn.layer.cornerRadius = 18;
    [self addSubview:self.withdrawBtn];
    [self.withdrawBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.height.mas_equalTo(36);
    }];
    
    //横向排列
    
    NSMutableArray *VerticalArray = [NSMutableArray array];
    [VerticalArray addObject:self.totalBtn];
    [VerticalArray addObject:self.shareProfitBtn];
    [VerticalArray addObject:self.withdrawBtn];
    
    [VerticalArray mas_distributeViewsAlongAxis:(MASAxisTypeHorizontal) withFixedSpacing:10 leadSpacing:15 tailSpacing:15];
    
}

@end
